package com.imti.config;

import lombok.Data;

import java.io.Serializable;

/**
 * 自定义异常
 *
 * @author T470S
 */
@Data
public class BusinessException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = -2675779811204300538L;

    private int code;
    private String message;

    public BusinessException(int code) {
        this.code = code;
    }

    public BusinessException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BusinessException(int code, Throwable e) {
        super(e);
        this.code = code;
    }

    public BusinessException(int code, Throwable e, String message) {
        super(message, e);
        this.code = code;
        this.message = message;
    }

    public BusinessException(String msg) {
        super(msg);
        this.message = msg;
    }

    public BusinessException(String msg, Throwable e) {
        super(msg, e);
        this.message = msg;
    }
}
